Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.2.5" /> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | a { |
| 20 | color: blue; |
| 21 | text-decoration: underline; |
| 22 | } |
| 23 | a:visited { |
| 24 | color: fuchsia; |
| 25 | } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 26 | |
| 27 | em { |
| 28 | font-style: italic; |
| 29 | } |
| 30 | |
| 31 | strong { |
| 32 | font-weight: bold; |
| 33 | } |
| 34 | |
| 35 | tt { |
| 36 | color: navy; |
| 37 | } |
| 38 | |
| 39 | h1, h2, h3, h4, h5, h6 { |
| 40 | color: #527bbd; |
| 41 | font-family: sans-serif; |
| 42 | margin-top: 1.2em; |
| 43 | margin-bottom: 0.5em; |
| 44 | line-height: 1.3; |
| 45 | } |
| 46 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 47 | h1, h2, h3 { |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 48 | border-bottom: 2px solid silver; |
| 49 | } |
| 50 | h2 { |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 51 | padding-top: 0.5em; |
| 52 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 53 | h3 { |
| 54 | float: left; |
| 55 | } |
| 56 | h3 + * { |
| 57 | clear: left; |
| 58 | } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 59 | |
| 60 | div.sectionbody { |
| 61 | font-family: serif; |
| 62 | margin-left: 0; |
| 63 | } |
| 64 | |
| 65 | hr { |
| 66 | border: 1px solid silver; |
| 67 | } |
| 68 | |
| 69 | p { |
| 70 | margin-top: 0.5em; |
| 71 | margin-bottom: 0.5em; |
| 72 | } |
| 73 | |
| 74 | pre { |
| 75 | padding: 0; |
| 76 | margin: 0; |
| 77 | } |
| 78 | |
| 79 | span#author { |
| 80 | color: #527bbd; |
| 81 | font-family: sans-serif; |
| 82 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 83 | font-size: 1.1em; |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 84 | } |
| 85 | span#email { |
| 86 | } |
| 87 | span#revision { |
| 88 | font-family: sans-serif; |
| 89 | } |
| 90 | |
| 91 | div#footer { |
| 92 | font-family: sans-serif; |
| 93 | font-size: small; |
| 94 | border-top: 2px solid silver; |
| 95 | padding-top: 0.5em; |
| 96 | margin-top: 4.0em; |
| 97 | } |
| 98 | div#footer-text { |
| 99 | float: left; |
| 100 | padding-bottom: 0.5em; |
| 101 | } |
| 102 | div#footer-badges { |
| 103 | float: right; |
| 104 | padding-bottom: 0.5em; |
| 105 | } |
| 106 | |
| 107 | div#preamble, |
| 108 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 109 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 110 | div.admonitionblock { |
| 111 | margin-right: 10%; |
| 112 | margin-top: 1.5em; |
| 113 | margin-bottom: 1.5em; |
| 114 | } |
| 115 | div.admonitionblock { |
| 116 | margin-top: 2.5em; |
| 117 | margin-bottom: 2.5em; |
| 118 | } |
| 119 | |
| 120 | div.content { /* Block element content. */ |
| 121 | padding: 0; |
| 122 | } |
| 123 | |
| 124 | /* Block element titles. */ |
| 125 | div.title, caption.title { |
| 126 | font-family: sans-serif; |
| 127 | font-weight: bold; |
| 128 | text-align: left; |
| 129 | margin-top: 1.0em; |
| 130 | margin-bottom: 0.5em; |
| 131 | } |
| 132 | div.title + * { |
| 133 | margin-top: 0; |
| 134 | } |
| 135 | |
| 136 | td div.title:first-child { |
| 137 | margin-top: 0.0em; |
| 138 | } |
| 139 | div.content div.title:first-child { |
| 140 | margin-top: 0.0em; |
| 141 | } |
| 142 | div.content + div.title { |
| 143 | margin-top: 0.0em; |
| 144 | } |
| 145 | |
| 146 | div.sidebarblock > div.content { |
| 147 | background: #ffffee; |
| 148 | border: 1px solid silver; |
| 149 | padding: 0.5em; |
| 150 | } |
| 151 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 152 | div.listingblock { |
| 153 | margin-right: 0%; |
| 154 | } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 155 | div.listingblock > div.content { |
| 156 | border: 1px solid silver; |
| 157 | background: #f4f4f4; |
| 158 | padding: 0.5em; |
| 159 | } |
| 160 | |
| 161 | div.quoteblock > div.content { |
| 162 | padding-left: 2.0em; |
| 163 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 164 | |
| 165 | div.attribution { |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 166 | text-align: right; |
| 167 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 168 | div.verseblock + div.attribution { |
| 169 | text-align: left; |
| 170 | } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 171 | |
| 172 | div.admonitionblock .icon { |
| 173 | vertical-align: top; |
| 174 | font-size: 1.1em; |
| 175 | font-weight: bold; |
| 176 | text-decoration: underline; |
| 177 | color: #527bbd; |
| 178 | padding-right: 0.5em; |
| 179 | } |
| 180 | div.admonitionblock td.content { |
| 181 | padding-left: 0.5em; |
| 182 | border-left: 2px solid silver; |
| 183 | } |
| 184 | |
| 185 | div.exampleblock > div.content { |
| 186 | border-left: 2px solid silver; |
| 187 | padding: 0.5em; |
| 188 | } |
| 189 | |
| 190 | div.verseblock div.content { |
| 191 | white-space: pre; |
| 192 | } |
| 193 | |
| 194 | div.imageblock div.content { padding-left: 0; } |
| 195 | div.imageblock img { border: 1px solid silver; } |
| 196 | span.image img { border-style: none; } |
| 197 | |
| 198 | dl { |
| 199 | margin-top: 0.8em; |
| 200 | margin-bottom: 0.8em; |
| 201 | } |
| 202 | dt { |
| 203 | margin-top: 0.5em; |
| 204 | margin-bottom: 0; |
| 205 | font-style: italic; |
| 206 | } |
| 207 | dd > *:first-child { |
| 208 | margin-top: 0; |
| 209 | } |
| 210 | |
| 211 | ul, ol { |
| 212 | list-style-position: outside; |
| 213 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 214 | div.olist2 ol { |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 215 | list-style-type: lower-alpha; |
| 216 | } |
| 217 | |
| 218 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 219 | border: 3px solid #527bbd; |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 220 | } |
| 221 | thead { |
| 222 | font-family: sans-serif; |
| 223 | font-weight: bold; |
| 224 | } |
| 225 | tfoot { |
| 226 | font-weight: bold; |
| 227 | } |
| 228 | |
| 229 | div.hlist { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 233 | div.hlist td { |
| 234 | padding-bottom: 5px; |
| 235 | } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 236 | td.hlist1 { |
| 237 | vertical-align: top; |
| 238 | font-style: italic; |
| 239 | padding-right: 0.8em; |
| 240 | } |
| 241 | td.hlist2 { |
| 242 | vertical-align: top; |
| 243 | } |
| 244 | |
| 245 | @media print { |
| 246 | div#footer-badges { display: none; } |
| 247 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 248 | |
| 249 | div#toctitle { |
| 250 | color: #527bbd; |
| 251 | font-family: sans-serif; |
| 252 | font-size: 1.1em; |
| 253 | font-weight: bold; |
| 254 | margin-top: 1.0em; |
| 255 | margin-bottom: 0.1em; |
| 256 | } |
| 257 | |
| 258 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 259 | margin-top: 0; |
| 260 | margin-bottom: 0; |
| 261 | } |
| 262 | div.toclevel2 { |
| 263 | margin-left: 2em; |
| 264 | font-size: 0.9em; |
| 265 | } |
| 266 | div.toclevel3 { |
| 267 | margin-left: 4em; |
| 268 | font-size: 0.9em; |
| 269 | } |
| 270 | div.toclevel4 { |
| 271 | margin-left: 6em; |
| 272 | font-size: 0.9em; |
| 273 | } |
| 274 | include1::./stylesheets/xhtml11-manpage.css[] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 275 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 276 | |
| 277 | div.sidebar-content { |
| 278 | background: #ffffee; |
| 279 | border: 1px solid silver; |
| 280 | padding: 0.5em; |
| 281 | } |
| 282 | div.sidebar-title, div.image-title { |
| 283 | font-family: sans-serif; |
| 284 | font-weight: bold; |
| 285 | margin-top: 0.0em; |
| 286 | margin-bottom: 0.5em; |
| 287 | } |
| 288 | |
| 289 | div.listingblock div.content { |
| 290 | border: 1px solid silver; |
| 291 | background: #f4f4f4; |
| 292 | padding: 0.5em; |
| 293 | } |
| 294 | |
| 295 | div.quoteblock-content { |
| 296 | padding-left: 2.0em; |
| 297 | } |
| 298 | |
| 299 | div.exampleblock-content { |
| 300 | border-left: 2px solid silver; |
| 301 | padding-left: 0.5em; |
| 302 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 303 | |
| 304 | /* IE6 sets dynamically generated links as visited. */ |
| 305 | div#toc a:visited { color: blue; } |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 306 | </style> |
| 307 | <title>gitcvs-migration(7)</title> |
| 308 | </head> |
| 309 | <body> |
| 310 | <div id="header"> |
| 311 | <h1> |
| 312 | gitcvs-migration(7) Manual Page |
| 313 | </h1> |
| 314 | <h2>NAME</h2> |
| 315 | <div class="sectionbody"> |
| 316 | <p>gitcvs-migration - |
| 317 | git for CVS users |
| 318 | </p> |
| 319 | </div> |
| 320 | </div> |
| 321 | <h2>SYNOPSIS</h2> |
| 322 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 323 | <div class="para"><p>git cvsimport *</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 324 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 325 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 326 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 327 | <div class="para"><p>Git differs from CVS in that every working tree contains a repository with |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 328 | a full copy of the project history, and no repository is inherently more |
| 329 | important than any other. However, you can emulate the CVS model by |
| 330 | designating a single shared repository which people can synchronize with; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 331 | this document explains how to do that.</p></div> |
| 332 | <div class="para"><p>Some basic familiarity with git is required. Having gone through |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 333 | <a href="gittutorial.html">gittutorial(7)</a> and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 334 | <a href="gitglossary.html">gitglossary(7)</a> should be sufficient.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 335 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 336 | <h2 id="_developing_against_a_shared_repository">Developing against a shared repository</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 337 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 338 | <div class="para"><p>Suppose a shared repository is set up in /pub/repo.git on the host |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 339 | foo.com. Then as an individual committer you can clone the shared |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 340 | repository over ssh with:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 341 | <div class="listingblock"> |
| 342 | <div class="content"> |
| 343 | <pre><tt>$ git clone foo.com:/pub/repo.git/ my-project |
| 344 | $ cd my-project</tt></pre> |
| 345 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 346 | <div class="para"><p>and hack away. The equivalent of <em>cvs update</em> is</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 347 | <div class="listingblock"> |
| 348 | <div class="content"> |
| 349 | <pre><tt>$ git pull origin</tt></pre> |
| 350 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | <div class="para"><p>which merges in any work that others might have done since the clone |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 352 | operation. If there are uncommitted changes in your working tree, commit |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 353 | them first before running git pull.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 354 | <div class="admonitionblock"> |
| 355 | <table><tr> |
| 356 | <td class="icon"> |
| 357 | <div class="title">Note</div> |
| 358 | </td> |
| 359 | <td class="content"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 360 | <div class="para"><p>The <em>pull</em> command knows where to get updates from because of certain |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 361 | configuration variables that were set by the first <em>git clone</em> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 362 | command; see <tt>git config -l</tt> and the <a href="git-config.html">git-config(1)</a> man |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 363 | page for details.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 364 | </td> |
| 365 | </tr></table> |
| 366 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 367 | <div class="para"><p>You can update the shared repository with your changes by first committing |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 368 | your changes, and then using the <em>git push</em> command:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 369 | <div class="listingblock"> |
| 370 | <div class="content"> |
| 371 | <pre><tt>$ git push origin master</tt></pre> |
| 372 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 373 | <div class="para"><p>to "push" those commits to the shared repository. If someone else has |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 374 | updated the repository more recently, <em>git push</em>, like <em>cvs commit</em>, will |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 375 | complain, in which case you must pull any changes before attempting the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 376 | push again.</p></div> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 377 | <div class="para"><p>In the <em>git push</em> command above we specify the name of the remote branch |
| 378 | to update (<tt>master</tt>). If we leave that out, <em>git push</em> tries to update |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 379 | any branches in the remote repository that have the same name as a branch |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 380 | in the local repository. So the last <em>push</em> can be done with either of:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 381 | <div class="listingblock"> |
| 382 | <div class="content"> |
| 383 | <pre><tt>$ git push origin |
| 384 | $ git push foo.com:/pub/project.git/</tt></pre> |
| 385 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 386 | <div class="para"><p>as long as the shared repository does not have any branches |
| 387 | other than <tt>master</tt>.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 388 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 389 | <h2 id="_setting_up_a_shared_repository">Setting Up a Shared Repository</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 390 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 391 | <div class="para"><p>We assume you have already created a git repository for your project, |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 392 | possibly created from scratch or from a tarball (see |
| 393 | <a href="gittutorial.html">gittutorial(7)</a>), or imported from an already existing CVS |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 394 | repository (see the next section).</p></div> |
| 395 | <div class="para"><p>Assume your existing repo is at /home/alice/myproject. Create a new "bare" |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 396 | repository (a repository without a working tree) and fetch your project into |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 397 | it:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 398 | <div class="listingblock"> |
| 399 | <div class="content"> |
| 400 | <pre><tt>$ mkdir /pub/my-repo.git |
| 401 | $ cd /pub/my-repo.git |
| 402 | $ git --bare init --shared |
| 403 | $ git --bare fetch /home/alice/myproject master:master</tt></pre> |
| 404 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 405 | <div class="para"><p>Next, give every team member read/write access to this repository. One |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 406 | easy way to do this is to give all the team members ssh access to the |
| 407 | machine where the repository is hosted. If you don't want to give them a |
| 408 | full shell on the machine, there is a restricted shell which only allows |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 409 | users to do git pushes and pulls; see <a href="git-shell.html">git-shell(1)</a>.</p></div> |
| 410 | <div class="para"><p>Put all the committers in the same group, and make the repository |
| 411 | writable by that group:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 412 | <div class="listingblock"> |
| 413 | <div class="content"> |
| 414 | <pre><tt>$ chgrp -R $group /pub/my-repo.git</tt></pre> |
| 415 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 416 | <div class="para"><p>Make sure committers have a umask of at most 027, so that the directories |
| 417 | they create are writable and searchable by other group members.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 418 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 419 | <h2 id="_importing_a_cvs_archive">Importing a CVS archive</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 420 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 421 | <div class="para"><p>First, install version 2.1 or higher of cvsps from |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 422 | <a href="http://www.cobite.com/cvsps/">http://www.cobite.com/cvsps/</a> and make |
| 423 | sure it is in your path. Then cd to a checked out CVS working directory |
Junio C Hamano | ea86833 | 2009-04-21 08:11:06 | [diff] [blame] | 424 | of the project you are interested in and run <a href="git-cvsimport.html">git-cvsimport(1)</a>:</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 425 | <div class="listingblock"> |
| 426 | <div class="content"> |
| 427 | <pre><tt>$ git cvsimport -C <destination> <module></tt></pre> |
| 428 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 429 | <div class="para"><p>This puts a git archive of the named CVS module in the directory |
| 430 | <destination>, which will be created if necessary.</p></div> |
| 431 | <div class="para"><p>The import checks out from CVS every revision of every file. Reportedly |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 432 | cvsimport can average some twenty revisions per second, so for a |
| 433 | medium-sized project this should not take more than a couple of minutes. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 434 | Larger projects or remote repositories may take longer.</p></div> |
| 435 | <div class="para"><p>The main trunk is stored in the git branch named <tt>origin</tt>, and additional |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 436 | CVS branches are stored in git branches with the same names. The most |
| 437 | recent version of the main trunk is also left checked out on the <tt>master</tt> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 438 | branch, so you can start adding your own changes right away.</p></div> |
| 439 | <div class="para"><p>The import is incremental, so if you call it again next month it will |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 440 | fetch any CVS updates that have been made in the meantime. For this to |
| 441 | work, you must not modify the imported branches; instead, create new |
| 442 | branches for your own changes, and merge in the imported branches as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 443 | necessary.</p></div> |
| 444 | <div class="para"><p>If you want a shared repository, you will need to make a bare clone |
| 445 | of the imported directory, as described above. Then treat the imported |
| 446 | directory as another development clone for purposes of merging |
| 447 | incremental imports.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 448 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 449 | <h2 id="_advanced_shared_repository_management">Advanced Shared Repository Management</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 450 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 451 | <div class="para"><p>Git allows you to specify scripts called "hooks" to be run at certain |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 452 | points. You can use these, for example, to send all commits to the shared |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 453 | repository to a mailing list. See <a href="githooks.html">githooks(5)</a>.</p></div> |
| 454 | <div class="para"><p>You can enforce finer grained permissions using update hooks. See |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 455 | <a href="howto/update-hook-example.txt">Controlling access to branches using |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 456 | update hooks</a>.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 457 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 458 | <h2 id="_providing_cvs_access_to_a_git_repository">Providing CVS Access to a git Repository</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 459 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 460 | <div class="para"><p>It is also possible to provide true CVS access to a git repository, so |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 461 | that developers can still use CVS; see <a href="git-cvsserver.html">git-cvsserver(1)</a> for |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 462 | details.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 463 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 464 | <h2 id="_alternative_development_models">Alternative Development Models</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 465 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 466 | <div class="para"><p>CVS users are accustomed to giving a group of developers commit access to |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 467 | a common repository. As we've seen, this is also possible with git. |
| 468 | However, the distributed nature of git allows other development models, |
| 469 | and you may want to first consider whether one of them might be a better |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 470 | fit for your project.</p></div> |
| 471 | <div class="para"><p>For example, you can choose a single person to maintain the project's |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 472 | primary public repository. Other developers then clone this repository |
| 473 | and each work in their own clone. When they have a series of changes that |
| 474 | they're happy with, they ask the maintainer to pull from the branch |
| 475 | containing the changes. The maintainer reviews their changes and pulls |
| 476 | them into the primary repository, which other developers pull from as |
| 477 | necessary to stay coordinated. The Linux kernel and other projects use |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 478 | variants of this model.</p></div> |
| 479 | <div class="para"><p>With a small group, developers may just pull changes from each other's |
| 480 | repositories without the need for a central maintainer.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 481 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 482 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 483 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 484 | <div class="para"><p><a href="gittutorial.html">gittutorial(7)</a>, |
Junio C Hamano | 9e1793f | 2008-06-02 07:31:16 | [diff] [blame] | 485 | <a href="gittutorial-2.html">gittutorial-2(7)</a>, |
| 486 | <a href="gitcore-tutorial.html">gitcore-tutorial(7)</a>, |
| 487 | <a href="gitglossary.html">gitglossary(7)</a>, |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 488 | <a href="everyday.html">Everyday Git</a>, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 489 | <a href="user-manual.html">The Git User's Manual</a></p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 490 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 491 | <h2 id="_git">GIT</h2> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 492 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 493 | <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite.</p></div> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 494 | </div> |
| 495 | <div id="footer"> |
| 496 | <div id="footer-text"> |
Junio C Hamano | ac752fa | 2010-09-19 00:01:00 | [diff] [blame] | 497 | Last updated 2010-09-18 23:57:05 UTC |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 498 | </div> |
| 499 | </div> |
| 500 | </body> |
| 501 | </html> |